import { detailApi } from '../api'
// import * as TYPE from '../actionType/rankType'
import _ from 'lodash'

const state = {
	detaillist: []
}

const getters = {
	detaillist: state => state.detaillist
}

const actions = {
	detaillist({commit, state, rootState},id) {
		rootState.requesting = true
		commit('DETAIL_LIST_REQUEST')
		detailApi.detaillist(id).then((response) => {
			rootState.requesting = false
			commit('DETAIL_LIST_SUCCESS', response)
		}, (error) => {
			rootState.requesting = false
			commit('DETAIL_LIST_FAILURE')
		})
	}
}

const mutations = {
	['DETAIL_LIST_REQUEST'] (state) {

	},
	['DETAIL_LIST_SUCCESS'] (state, response) {
		state.detaillist = response.data
		
	},
	['DETAIL_LIST_FAILURE'] (state) {

	}
}

export default {
	state,
	getters,
	actions,
	mutations
}